<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>${message("admin.admin.list")}</title>
<meta name="author" content="EVOLUTION Team" />
<meta name="copyright" content="EVOLUTION" />
<link href="${base}/resources/admin/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/resources/admin/js/jquery.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/common.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/list.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/jquery.tools.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/jquery.lSelect.js"></script>
<script type="text/javascript" src="${base}/resources/admin/editor/kindeditor.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/input.js"></script>
<script type="text/javascript" src="${base}/resources/admin/datePicker/WdatePicker.js"></script>
<script type="text/javascript">
$().ready(function() {

	var $inputForm = $("#inputForm");
	var $currentAreaId = $("#currentAreaId");
	
	$("#criminalCategory").val("${displayCriminalCategory}");
	$("#penaltyCategory").val("${displayPenaltyCategory}");
	$("#temporaryGuy").val("${displayTemporaryGuy}");
	$("#currentAreaId").val("${displayCurrentArea}");
	
 
	// 现地址选择
    $currentAreaId.lSelect({
		url: "${base}/common/area.jhtml"
	});	
	
	$("#reset").click(function(){	
		$("#idCardNum").val("");
	 	$("#name").val("");
		$("#criminalCategory").val("");
		$("#penaltyCategory").val("");
		$("#temporaryGuy").val("");
		$("#currentAreaId").val("");
		$('#fromDate').val(""); 
		$('#toDate').val("");
	});
	
	[@flash_message /]

});

</script>
</head>
<body>	
	<div class="path">
		<a href="${base}/admin/common/index.jhtml">${message("admin.path.index")}</a> &raquo; ${message("admin.message.criminalSearch")}
	</div>
	<form id="listForm" action="list.jhtml" method="get">
	    <table class="input">
	        <tr>
	            <td colspan="4">
	               ${message("admin.message.searchTitle")}
	            </td>
	        </tr>
	        <tr>
	            <th>
	                ${message("admin.message.cardId")}:
	            </th>
	            <td>
	                <input type="text" id="idCardNum" name="idCardNum" value="${displayIdCardNum}" maxlength="100" />
	             </td>
	            <th>
	                ${message("admin.message.name")}：
	            </th>
	            <td>
	                <input type="text" id="name" name="name" value="${displayName}"/>
	             </td>
	        </tr>
	        <tr>
	            <th>
	               ${message("admin.message.caseCriminal")}:
	            </th>
	            <td>
	              <select name="criminalCategory" id="criminalCategory">
			         <option value="">${message("admin.common.choose")}</option>
			           [#list criminalCategoryGroup as masterConfig ]
				             <option value="${masterConfig.cd}">
				                ${masterConfig.decode}
				             </option>
			           [/#list]
		          </select>
	             </td>
	             <th>
	                ${message("admin.message.casePenalty")}:
	             </th>
	             <td>
	               <select name="penaltyCategory" id="penaltyCategory">
		       	   		<option value="">${message("admin.common.choose")}</option>
		           		[#list penaltyCategoryGroup as masterConfig ]
			             	<option value="${masterConfig.cd}">
			                ${masterConfig.decode}
			             	</option>
		          		 [/#list]
	           	   </select>	                
	             </td>
	         </tr>
	        <tr>
	            <th>
	         	    ${message("admin.message.temporary")}:
	            </th>
	            <td colspan="3">
	                <select name="temporaryGuy" id="temporaryGuy">
				      <option value="">${message("admin.common.choose")}</option>
		           	    [#list commonBool as masterConfig ]
			              <option value="${masterConfig.cd}">
			                ${masterConfig.decode}
			              </option>
		          	    [/#list]				    
		       	    </select>		                
	            </td>
	        </tr>
	        <tr>
	            <th>
	         	    ${message("admin.message.currentAreaName")}:
	            </th>
	            <td colspan="3">
         	       <span class="fieldSet">
	        		  <input type="hidden" id="currentAreaId" name="currentArea" value="${(currentArea.id)!}" treePath="${(currentArea.treePath)!}" />
	      		   </span> 	                
	            </td>	        
	        </tr>
	        <tr>
	            <th>
	               ${message("admin.message.recordDate")}:
	            </th>
	            <td colspan="4">
                     <input type="text" id="fromDate" name="fromDate" value="${diaplayFromDate}"class="text Wdate" onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm:ss', maxDate: '#F{$dp.$D(\'fromDate\')}'});" /> 
	         	     &nbsp;&nbsp;${message("admin.message.searchToDate")}:<input type="text" id="toDate" name="toDate" value="${diaplayToDate}" class="text Wdate" onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm:ss', maxDate: '#F{$dp.$D(\'toDate\')}'});" />
	            </th>
	        </tr>
         	<tr>
         	    <td colspan="4">
         	    <div style="text-align:center;">
                    <button type="submit" name="search">${message("admin.message.search")}</button>
         		    &nbsp;&nbsp;&nbsp;<button type="button" id="reset" name="reset">${message("admin.message.reset")}</button>         	    
         	    </div>
         	    <td>
         	</tr>	        	        	        
	    </table>
		<br/>
		<div class="bar">
			<a href="add.jhtml" class="iconButton">
				<span class="addIcon">&nbsp;</span>${message("admin.common.add")}
			</a>
			<div class="buttonWrap">
				<a href="javascript:;" id="deleteButton" class="iconButton disabled">
					<span class="deleteIcon">&nbsp;</span>${message("admin.common.delete")}
				</a>
				<a href="javascript:;" id="refreshButton" class="iconButton">
					<span class="refreshIcon">&nbsp;</span>${message("admin.common.refresh")}
				</a>
				<div class="menuWrap">
					<a href="javascript:;" id="pageSizeSelect" class="button">
						${message("admin.page.pageSize")}<span class="arrow">&nbsp;</span>
					</a>
					<div class="popupMenu">
						<ul id="pageSizeOption">
							<li>
								<a href="javascript:;"[#if page.pageSize == 10] class="current"[/#if] val="10">10</a>
							</li>
							<li>
								<a href="javascript:;"[#if page.pageSize == 20] class="current"[/#if] val="20">20</a>
							</li>
							<li>
								<a href="javascript:;"[#if page.pageSize == 50] class="current"[/#if] val="50">50</a>
							</li>
							<li>
								<a href="javascript:;"[#if page.pageSize == 100] class="current"[/#if] val="100">100</a>
							</li>
						</ul>
					</div>
				</div>
			</div>			
		</div>
		<table id="listTable" class="list">
			<tr>				
				<th class="check">
					<input type="checkbox" id="selectAll" />
				</th>
				<th>
					<a href="javascript:;" class="sort" name="name">${message("admin.message.name")}</a>
				</th>
				<th>
					<a href="javascript:;" class="sort" name="gender">${message("admin.message.gender")}</a>
				</th>
				<th>
					<a href="javascript:;" class="sort" name="idCardNum">${message("admin.message.cardId")}</a>
				</th>
				<th>
					<a href="javascript:;" class="sort" name="profession">${message("admin.message.profession")}</a>
				</th>
				<th>
					<a href="javascript:;" class="sort" name="ethnic">${message("admin.message.ethnic")}</a>
				</th>
				<th>
					<a href="javascript:;" class="sort" name="caseCriminal">${message("admin.message.caseCriminal")}</a>
				</th>
				<th>
					<a href="javascript:;" class="sort" name="casePenalty">${message("admin.message.casePenalty")}</a>
				</th>				
				<th>
					<a href="javascript:;" class="sort" name="currentAddress">${message("admin.message.currentAddress")}</a>
				</th>
				<th>
					<a href="javascript:;" class="sort" name="temporaryGuy">${message("admin.message.temporaryChoice")}</a>
				</th>
				<th>
					<a href="javascript:;" class="sort" name="contactNumber">${message("admin.message.cellPhoneNumber")}</a>
				</th>			
				<th>
					<span>${message("admin.common.handle")}</span>
				</th>
			</tr>
			[#list page.content as criminal]
				<tr>
					<td>
						<input type="checkbox" name="ids" value="${criminal.id}" />
					</td>
					<td>
						${criminal.name}
					</td>
					<td>
					    [#list genderGroup as masterConfig ]
					       [#if "${criminal.gender}" == "${masterConfig.cd}" ]
					          ${masterConfig.decode}
					       [/#if]
					    [/#list]					
					</td>
					<td>
						${criminal.idCardNum}
					</td>
					<td>
						[#list professionGroup as masterConfig ]
						[#if "${criminal.profession}" == "${masterConfig.cd}"]
							${masterConfig.decode}
						[/#if]			             
			            [/#list]
					</td>
					<td>						
					 	${criminal.ethnic}
					</td>
					<td>		
						[#list "${criminal.caseCriminal}"?split(",") as case]
					    	[#list criminalCategoryGroup as masterConfig ]
					    		[#if "${case}" == "${masterConfig.cd}"]
					    			${masterConfig.decode}
					    		[/#if]
					    	[/#list]
					    [/#list]		
					</td>
					<td>
					    [#list "${criminal.casePenalty}"?split(",") as case]
					    	[#list penaltyCategoryGroup as masterConfig ]
					    		[#if "${case}" == "${masterConfig.cd}"]
					    			${masterConfig.decode}
					    		[/#if]
					    	[/#list]
					    [/#list]		
					</td>					
					<td>
						${criminal.currentAddress}
					</td>
					<td>
					   [#list commonBool as masterConfig ]
					       [#if "${criminal.temporaryGuy}" == "${masterConfig.cd}" ]
					          ${masterConfig.decode}
					       [/#if]
					    [/#list]	
					</td>			
					<td>
						${criminal.contactNumber}
					</td>	
									
					<td>
						<a href="edit.jhtml?id=${criminal.id}">[${message("admin.common.edit")}]</a>
						<a href="view.jhtml?id=${criminal.id}">[${message("admin.common.view")}]</a>
					</td>
				</tr>
			[/#list]
		</table>
		[@pagination pageNumber = page.pageNumber totalPages = page.totalPages]
			[#include "/admin/include/pagination.ftl"]
		[/@pagination]
	</form>
</body>
</html>